{% extends "base.html" %}

{% load crispy_forms_tags i18n translations %}

{% block breadcrumbs %}
  <li class="breadcrumb-item">
    <a href="{% url 'profile' %}">{% translate "Your profile" %}</a>
  </li>
{% endblock breadcrumbs %}

{% block content %}

  <form method="post" action="{% url 'remove' %}">
    <div class="card">
      <div class="card-header">
        <h4 class="card-title">{% translate "Account removal" %}</h4>
      </div>
      <div class="card-body">
        {{ confirm_form|crispy }}
        <ul>
          <li>{% translate "Account removal deletes all your private data." %}</li>
          {% if user.owned_projects %}
            <li>
              {% translate "You will lose access to the projects you manage. Projects themselves will not be removed." %}
              <ul>
                {% for project in user.owned_projects %}
                  <li>
                    <a href="{{ project.get_absolute_url }}">{{ project }}</a>
                  </li>
                {% endfor %}
              </ul>
            </li>
          {% endif %}
          {% if has_billing %}
            <li>{% translate "Any billing you might have created will not be terminated by this account removal." %}</li>
          {% endif %}
          {% if is_confirmation %}
            <li>
              {% blocktranslate %}By pressing the following button, you will no longer be able to use this account.{% endblocktranslate %}
            </li>
          {% else %}
            <li>
              {% blocktranslate %}You will have to confirm the account removal by clicking the link in the e-mail you will receive.{% endblocktranslate %}
            </li>
          {% endif %}
        </ul>
        {% csrf_token %}
      </div>
      <div class="card-footer">
        <button type="submit" class="btn btn-danger">{% translate "Delete this account" %}</button>
      </div>
    </div>
  </form>

{% endblock content %}
